﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace GenericTypes
{
    //定义一个泛型类 用来模拟stack
    //栈stack是单边取补，先进后出
  public   class Stack<T>
    {
      int position;
      T[] data = new T[100];
      public void push(T obj) {data[position++] = obj; }
      public T Pop() { return data[--position]; }

    }
}
